package com.kymatrix.mpo.plus.bpm.server.model.form.category;

import com.kymatrix.mpo.plus.bpm.server.model.entity.definition.BpmCategoryEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.experimental.Accessors;

@ApiModel(value = "管理后台 - BPM 流程分类 Response")
@Data
@Accessors(chain=true)
public class PageQueryBpmCategoryResp  {

    @ApiModelProperty(value = "分类编号", example = "3167")
    private String id;

    @ApiModelProperty(value = "分类名")
    private String name;

    @ApiModelProperty(value = "分类标志", example = "OA")
    private String code;

    @ApiModelProperty(value = "分类描述", example = "你猜")
    private String description;

    @ApiModelProperty(value = "分类状态 EnableType", example = "1")
    private String status;

    @ApiModelProperty(value = "分类排序")
    private Integer sort;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;
    
    public static PageQueryBpmCategoryResp fromEntity(BpmCategoryEntity entity) {
        PageQueryBpmCategoryResp resp = new PageQueryBpmCategoryResp();
        resp.setId(entity.getId());
        resp.setName(entity.getName());
        resp.setCode(entity.getCode());
        resp.setDescription(entity.getDescription());
        resp.setStatus(entity.getStatus());
        resp.setSort(entity.getSort());
        resp.setCreateTime(entity.getCreateTime());
        return resp;
    }
    

}
